package main

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

func main() {
	r := gin.Default()
	r.GET("/json", json)
	r.GET("/purejson", pureJson)
	r.Run()
}

func pureJson(c *gin.Context) {
	c.PureJSON(http.StatusOK, gin.H{"html": "<h2>Hello</h2>"})
}

func json(c *gin.Context) {
	c.JSON(http.StatusOK, gin.H{
		"html": "<h2>Hello</h2>",
	})
}
